package in.freshstart.java.training.arrays;

public class LinearSearch {
	public int linearSearch(int a[], int first, int last, int key) {

		for (int i = first; i <= last; i++) {
			if (key == a[i]) {
				return i;
			}
		}
		return -1;
	}

}
